import request from '@/utils/request'

export function fetchRefundList(params={}) {
  return request('/Amaidan-Order-Web/summary/queryAccountStatementRefund', {
    method: 'POST',
    data: params
  })
}

export function fetchSaleList(params={}) {
  return request('/Amaidan-Order-Web/summary/queryAccountStatementSales', {
    method: 'POST',
    data: params
  })
}

// 获取 POS机 列表
export function fetchPosList(params={}) {
  return request('/Amaidan-Merchants-Web/merchants/busStorePos/queryStorePosSelectList', {
    method: 'POST',
    data: params
  })
}

// 根据商户id获该商户下的门店列表
export function fetchStoresList(params={}) {
  return request('/Amaidan-Merchants-Web/merchants/busStoreInfo/getStorePageByMerchantsId', {
    method: 'POST',
    data: params
  })
}

// 绑卡
export function bindBankCard(params={}) {
  return request('/Amaidan-Merchants-Web/merchants/busStoreBankCard/bindStoreBankCard', {
    method: 'POST',
    data: params
  })
}

// 解绑
export function delBankCard(params={}) {
  return request('/Amaidan-Merchants-Web/merchants/busStoreBankCard/deleteStoreBankCardInfo', {
    method: 'POST',
    data: params
  })
}

// 卡信息
export function getBankCardInfo(params={}) {
  return request('/Amaidan-Merchants-Web/merchants/busStoreBankCard/getStoreBankCardInfo', {
    method: 'POST',
    data: params
  })
}


// 财务报表列表
export function fetchReportList(params={}) {
  return request('/Amaidan-Order-Web/summary/queryFinancialReportList', {
    method: 'POST',
    data: params,
  })
}
// 总交易 总退款
export function fetchFinaRpt(params={}) {
  return request('/Amaidan-Order-Web/summary/statisticsFinancialReport', {
    method: 'POST',
    data: params,
  })
}

// 结算单查询
export function fetchSltOrders(params={}) {
  return request('/Amaidan-Order-Web/settlement/querySettlementOrderPageList', {
    method: 'POST',
    data: params,
  })
}

// 财务报表列表
export function exportExcel(params={}) {
  return request('/Amaidan-Order-Web/data/report/exportFinanciaReport', {
    method: 'POST',
    data: params,
    headers: {
      'Content-Type': 'application/vnd.ms-excel;charset=utf-8',
      'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3',
      'Content-Disposition': 'attachment;filename=财务报表导出.xlsx'
    }
  })
}

// 费率清算列表
export function fetchRateList(params={}) {
  return request('/Amaidan-Order-Web/order/liquidation/queryLiquidationList', {
    method: 'POST',
    data: params
  })
}

// pdf 导出
export function exportPDF(params={}) {
  return request('/Amaidan-Order-Web/data/report/exportLiquidationPDF', {
    method: 'POST',
    data: params,
    headers: {
      'Content-Type': 'application/vnd.ms-excel;charset=utf-8',
      'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3',
      'Content-Disposition': 'attachment;filename=费率清算表导出.pdf'
    }
  })
}

// 费率清算统计
export function fetchFlqsInfo(params={}) {
  return request('/Amaidan-Order-Web/order/liquidation/queryLiquidationInfoSummary', {
    method: 'POST',
    data: params
  })
}


// 获取品牌列表
export function fetchBrandsList(params={}) {
  return request('/Amaidan-Goods-Web/resGoodsBrand/brandsList', {
    method: 'POST',
    data: params
  })
}

// 品牌销售明细列表
export function fetchSaleDetail(params={}) {
  return request('/Amaidan-Order-Web/order-brand/queryAmdOrderBrandInfoPageList', {
    method: 'POST',
    data: params
  })
}

// pdf 导出
export function exportBrandReportPDF(params={}) {
  return request('/Amaidan-Order-Web/data/report/exportBrandReportDetailList', {
    method: 'POST',
    data: params,
    headers: {
      'Content-Type': 'application/vnd.ms-excel;charset=utf-8',
      'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3',
      'Content-Disposition': 'attachment;filename=品牌销售明细.pdf'
    }
  })
}

// 品牌统计报表列表
export function fetchBrandRptList(params={}) {
  return request('/Amaidan-Order-Web/order-brand/queryOrderBrandReportList', {
    method: 'POST',
    data: params
  })
}

// 品牌报表统计-总统
export function fetchBrandRptTotal(params={}) {
  return request('/Amaidan-Order-Web/order-brand/statisticsBrandReportTotal', {
    method: 'POST',
    data: params
  })
}


// 销售统计 -> 商品统计 -> 获取商品列表
export function fetchGoodsList(params={}) {
  return request('/Amaidan-Order-Web/order/query/queryGoodsSalesStatistics', {
    method: 'POST',
    data: params
  })
}
